<?
require_once('TimeLine.Abstract.class.php');

/** TimeLine worker class */
class TimeLineWorker extends TimeLine_Abstract{	// class start

	/** gearman feed timeline */
	public function feed($param){
		if(isset($param['receiver_mids']) && is_array($param['receiver_mids'])){
			$timeline_user_data = $param['timeline_user_data'];
			foreach($param['receiver_mids'] as $mid){
				$mid = intval($mid);
				$timeline_user_data['mid'] = $mid;
				$user_table = 'timeline_user_' . $this->get_table($mid);
				if($param['group']){
					db_del($user_table, array(
						'mid' => $mid,
						'key' => $timeline_user_data['key']
					), $this->config['db']);
				}
				db_add($user_table, $timeline_user_data, $this->config['db']);
			}
		}
	}


	/** abstract function */
	public function get_receiver($mid, $type='', $content=''){}

}	// class end
?>
